//4：输出今年的星期天都是几号
package Work0529;

import java.text.SimpleDateFormat;
import java.util.Calendar;

public class Sunday {

	public static void main(String[] args) {
		Calendar day = Calendar.getInstance();
		System.out.println("星期天都有:");
		for (int a = 1; a <= day.getActualMaximum(Calendar.DAY_OF_YEAR); a++) {
			day.set(Calendar.DAY_OF_YEAR, a);
			if (day.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY) {
				String d = new SimpleDateFormat("yyyy/MM/dd").format(day.getTime());
				System.out.println(d);
			}
		}
	}

}
